<!--
 * @Date: 2025-09-09 20:56:50
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-09-14 19:40:00
 * @FilePath: /admin-vue/src/components/ad/ad-form-item.vue
-->
<script setup lang="ts">
// 定义组件 props
const { field } = defineProps<{
  field: string
}>()

const errors = useErrorStore()

onMounted(() => {
  errors.clearError(field)
})
</script>

<template>
  <n-form-item
    :validation-status="errors.hasError(field)"
    :feedback="errors.getError(field)"
    :path="field"
  >
    <slot />
  </n-form-item>
</template>
